/*
 * Copyright (C) 2009 Jiannan Lu
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.restsql.atom;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author L
 */
public class Workspace {
   
    private String title = null;
    private String titleType = null; // may be TEXT, HTML, XHTML
    private List collections = new ArrayList();

    /**
     * Collection MUST have title.
     * @param title    Title for collection
     * @param titleType Content type of title (null for plain text)
     */
    public Workspace(String title, String titleType) {
        this.title = title;
        this.titleType = titleType;
    }

    public Workspace(){
       // parseWorkspaceElement(elem);
    }

    /** Iterate over collections in workspace */
    public List getCollections() {
        return collections;
    }

    /** Add new collection to workspace */
    public void addCollection(Collection col) {
        collections.add(col);
    }

    /**
     * DefaultWorkspace must have a human readable title
     */
    public String getTitle() {
        return title;
    }

    /**
     * Set title of workspace.
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * Get title type ("text", "html", "xhtml" or MIME content-type)
     */
    public String getTitleType() {
        return titleType;
    }

    /**
     * Set title type ("text", "html", "xhtml" or MIME content-type)
     */
    public void setTitleType(String titleType) {
        this.titleType = titleType;
    }
}
